% Function converts the floating value into fixed point
% representation, 32bit. 16bit is the integer and 16bin
% decimal part. The same representation is used in the 
% AVR's fixed point library. 
%
% The function perform poor man conversion into two's 
% complement by subverting the value from 2^32.
function ret=d2fp( num )
	limit = 2^32;
	if( num < 0 ) 
		num = abs(num);
		num = floor(num * 0x10000);
		num = limit - num;
	else
		num = floor(num * 0x10000);
	endif
	ret = dec2hex(num,8);
endfunction
